import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/dashboard',
                    component: () => import('../components/page/Dashboard.vue'),
                    meta: { title: '系统首页' }
                },
                {
                    path: '/salesShareStatistics',
                    component: () => import('../components/page/platform/SalesShareStatistics.vue'),
                    meta: { title: '销售额占比统计' }
                },
                {
                    path: '/petOwner',
                    component: () => import('../components/page/platform/PetOwner.vue'),
                    meta: { title: '宠主管理' }
                },
                {
                    path: '/salesTotal',
                    component: () => import('../components/page/platform/salesTotal.vue'),
                    meta: { title: '销售额统计' }
                },
                {
                    path: '/pos-list',
                    component: () => import('../components/page/platform/pos-list.vue'),
                    meta: { title: '所有门店信息' }
                },
                {
                    path: '/pos-open',
                    component: () => import('../components/page/platform/pos-open.vue'),
                    meta: { title: '待审核门店' }
                },
                {
                    path: '/pos-close',
                    component: () => import('../components/page/platform/pos-close.vue'),
                    meta: { title: '封禁中门店' }
                },
                {
                    path: '/pos-nopass',
                    component: () => import('../components/page/platform/pos-nopass.vue'),
                    meta: { title: '不通过门店' }
                },
                {
                    path: '/showRequest',
                    component: () => import('../components/page/sms/showRequest.vue'),
                    meta: { title: '门店申请' }
                },
                {
                    path: '/pos-sale',
                    component: () => import('../components/page/platform/pos-sale.vue'),
                    meta: { title: '门店销量统计' }
                },
                {
                    path: '/pos-saleroom',
                    component: () => import('../components/page/platform/saleroom.vue'),
                    meta: { title: '门店销量统计' }
                },

                {
                    path: '/supplierManage',
                    component: () => import('../components/page/platform/SupplierManage.vue'),
                    meta: { title: '供应商管理' }
                },
                {
                    path: '/userManage',
                    component: () => import('../components/page/platform/UserManage.vue'),
                    meta: { title: '用户管理' }
                },
                {
                    path: '/vendor',
                    component: () => import('../components/page/srm/Vendor.vue'),
                    meta: { title: '供应商资料管理' }
                },
                {
                    path: '/suppliersGoods',
                    component: () => import('../components/page/srm/SuppliersGoods.vue'),
                    meta: { title: '供应商货品管理' }
                },
                {
                    path: '/supplierEntry',
                    component: () => import('../components/page/srm/SupplierEntry.vue'),
                    meta: { title: '供应商货品录入' }
                },
                {
                    path: '/supplierList',
                    component: () => import('../components/page/srm/SupplierList.vue'),
                    meta: { title: '供应商货品查找' }
                },
                {
                    path: '/selectSuppliers',
                    component: () => import('../components/page/srm/selectSuppliers.vue'),
                    meta: { title: '选择供应商货品' }
                },
                {
                    path: '/selectSuppliersList',
                    component: () => import('../components/page/srm/selectSuppliersList.vue'),
                    meta: { title: '选择供应商货品订单' }
                },
                {
                    path: '/supplierData',
                    component: () => import('../components/page/srm/supplierData.vue'),
                    meta: { title: '供货商销售统计' }
                },
                {
                    path: '/goodsManage',
                    component: () => import('../components/page/sms/GoodsManage.vue'),
                    meta: { title: '商品管理' }
                },
                {
                    path: '/serviceManage',
                    component: () => import('../components/page/sms/ServiceManage.vue'),
                    meta: { title: '服务管理' }
                },
                {
                    path: '/storeApplication',
                    component: () => import('../components/page/sms/StoreApplication.vue'),
                    meta: { title: '门店申请' }
                },
                {
                    path: '/orderManage',
                    component: () => import('../components/page/sms/OrderManage.vue'),
                    meta: { title: '订单管理' }
                },
                {
                    path: '/selectSupplier',
                    component: () => import('../components/page/sms/SelectSupplier.vue'),
                    meta: { title: '选择供应商货品' }
                },
                {
                    path: '/distribution',
                    component: () => import('../components/page/platform/Distribution.vue'),
                    meta: { title: '门店分布图' }
                },
            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '/reg',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Reg.vue'),
            meta: { title: '注册' }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});
